package com.zhentao.controller;

import com.zhentao.domain.Product;
import com.zhentao.domain.dto.ProductFindAllDto;
import com.zhentao.service.ProductService;
import com.zhentao.until.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private ProductService productService;

    @PostMapping("/findAll")
    public ResponseResult findAll(@RequestBody ProductFindAllDto dto){
        return productService.findALl(dto);
    }

    @PostMapping("/save")
    public ResponseResult ProductSave(@RequestBody Product product){
        return productService.ProductSave(product);
    }
}
